execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry [..])
+[INSTALLING] foo v0.0.1
[COMPILING] foo v0.0.1
[FINISHED] release [optimized] target(s) in [..]
[INSTALLING] {home}[..]bin[..]foo[..]
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.2 (registry [..])
+[INSTALLING] foo v0.0.2
[COMPILING] foo v0.0.2
[FINISHED] release [optimized] target(s) in [..]
[INSTALLING] {home}[..]bin[..]foo[..]
assert_that(cargo_home(), has_installed_exe("foo"));
assert_that(cargo_process("install").arg("--path").arg(".").cwd(p.root()),
execs().with_status(101).with_stderr("\
+[INSTALLING] foo v0.1.0 [..]
[ERROR] binary `foo[..]` already exists in destination as part of `foo v0.1.0 [..]`
Add --force to overwrite
"));
assert_that(cargo_process("install").arg("--path").arg(p.root()).arg("foo"),
execs().with_status(101).with_stderr("\
+[INSTALLING] foo [..]
[ERROR] specified package has no binaries
"));
}
execs().with_status(0));
assert_that(cargo_process("install").arg("--path").arg(p.root()),
execs().with_status(101).with_stderr("\
+[INSTALLING] foo v0.1.0 [..]
[ERROR] binary `foo-bin1[..]` already exists in destination as part of `foo v0.1.0 ([..])`
binary `foo-bin2[..]` already exists in destination as part of `foo v0.1.0 ([..])`
Add --force to overwrite
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stderr(&format!("\
+[INSTALLING] foo v0.2.0 ([..])
[COMPILING] foo v0.2.0 ([..])
[FINISHED] release [optimized] target(s) in [..]
[REPLACING] {home}[..]bin[..]foo[..]
assert_that(cargo_process("install").arg("--force").arg("--path").arg(p.root()),
execs().with_status(0).with_stderr(&format!("\
+[INSTALLING] foo v0.2.0 ([..])
[COMPILING] foo v0.2.0 ([..])
[FINISHED] release [optimized] target(s) in [..]
[INSTALLING] {home}[..]bin[..]foo-bin3[..]
.arg("--path")
.arg(p.root()),
execs().with_status(0).with_stderr(&format!("\
+[INSTALLING] foo v0.2.0 ([..])
[COMPILING] foo v0.2.0 ([..])
[FINISHED] release [optimized] target(s) in [..]
[REPLACING] {home}[..]bin[..]foo-bin2[..]
assert_that(cargo_process("install").arg("--locked").arg("--git").arg(p.url().to_string()),
execs().with_status(0).with_stderr(&format!("\
[UPDATING] git repository `[..]`
+[INSTALLING] foo v0.1.0 ([..])
[COMPILING] foo v0.1.0 ([..])
[FINISHED] release [optimized] target(s) in [..]
[INSTALLING] {home}[..]bin[..]foo[..]
assert_that(p.cargo_process("build").arg("--release"),
execs().with_status(0));
assert_that(cargo_process("install").arg("--path").arg(p.root()),
- execs().with_status(0).with_stderr("[FINISHED] release [optimized] target(s) in [..]
+ execs().with_status(0).with_stderr("[INSTALLING] [..]
+[FINISHED] release [optimized] target(s) in [..]
[INSTALLING] [..]
warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
"));